/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* 字体系统 */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-display: 'Montserrat', sans-serif;
    --line-height-body: 1.7;
    --line-height-heading: 1.3;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-wide: 0.05em;

    /* 颜色系统 */
    --color-primary: #507497;
    --color-secondary: #4CAF50;
    --color-accent: #FF6B6B;
    --color-light: #f8f9fa;
    --color-dark: #333;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-background: #ffffff;
    --color-code-bg: #2d3748;
    --color-code-text: #e2e8f0;
    --color-border: #e2e8f0;
    --color-success: #48BB78;
    --color-warning: #ECC94B;
    --color-error: #F56565;
}

body {
    font-family: var(--font-sans);
    line-height: var(--line-height-body);
    color: var(--color-text);
    background-color: var(--color-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

/* 头部导航样式 */
header {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: var(--letter-spacing-tight);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
    position: relative;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s ease;
}

/* 教程容器布局 */
.tutorial-container {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
}

.tutorial-sidebar {
    flex: 0 0 250px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.tutorial-sidebar h3 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.tutorial-nav {
    list-style: none;
}

.tutorial-nav li {
    margin-bottom: 0.5rem;
}

.tutorial-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tutorial-nav a:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
}

.tutorial-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tutorial-content h1 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.intro {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    padding: 1rem;
    background-color: var(--color-light);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: var(--color-primary);
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
    font-family: var(--font-display);
    font-weight: 600;
}

.section h3 {
    color: var(--color-text);
    margin: 1.5rem 0 1rem;
    font-family: var(--font-display);
    font-weight: 500;
}

/* 代码块样式 */
.code-block {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-block code {
    color: #81e6d9;
}

.code-block .keyword {
    color: #ff6b6b;
}

.code-block .comment {
    color: #a0aec0;
    font-style: italic;
}

.code-block .string {
    color: #90cdf4;
}

.code-block .number {
    color: #f6ad55;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: var(--color-light);
}

/* 列表样式 */
ul,
ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.nav-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.nav-button:hover {
    background-color: #3e6b8f;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/hero.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(76, 175, 80, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    transform: scale(0);
    opacity: 0;
    transition: all 1s ease;
}

.hero:hover::before {
    transform: scale(1);
    opacity: 1;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.2s;
}

.hero p {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: var(--line-height-body);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.4s;
}

.btn {
    display: inline-block;
    background-color: var(--color-secondary);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: var(--letter-spacing-wide);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.6s;
}

.btn:hover {
    background-color: #3e8e41;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 特性区域样式 */
.features {
    padding: 6rem 0;
    background-color: var(--color-light);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, white, transparent);
    z-index: 1;
}

.features h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 4rem;
    color: var(--color-text);
    position: relative;
    padding-bottom: 1rem;
}

.features h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--color-secondary);
    border-radius: 2px;
}

.feature-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.feature-box {
    flex: 1 1 300px;
    padding: 2.5rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: var(--color-secondary);
    transition: all 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-box:hover::before {
    width: 100%;
    opacity: 0.1;
}

.feature-box i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
    transition: all 0.3s ease;
}

.feature-box:hover i {
    transform: scale(1.1) rotate(5deg);
}

.feature-box h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--color-text);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
}

.feature-box p {
    font-family: var(--font-sans);
    color: var(--color-text-light);
    line-height: var(--line-height-body);
}

/* 学习反馈区域样式 */
.testimonials {
    padding: 6rem 0;
    background-color: white;
    position: relative;
    overflow: hidden;
}

.testimonials::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color-light);
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
    z-index: 0;
}

.testimonials h2 {
    font-family: var(--font-display);
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 4rem;
    color: var(--color-text);
    position: relative;
    z-index: 1;
    padding-bottom: 1rem;
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
}

.testimonials h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--color-secondary);
    border-radius: 2px;
}

.testimonial-box {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-box p {
    font-style: italic;
    color: var(--color-text);
    line-height: var(--line-height-body);
}

.testimonial-box .author {
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 1rem;
    font-style: normal;
}

/* 页脚样式 */
footer {
    background-color: var(--color-dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    font-family: var(--font-sans);
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .tutorial-container {
        flex-direction: column;
    }

    .tutorial-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0px;
        height: 92vh;
        top: 8vh;
        background-color: var(--color-dark);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 100;
    }

    .nav-links li {
        opacity: 0;
        margin: 1.5rem 0;
    }

    .burger {
        display: block;
    }

    .nav-active {
        transform: translateX(0%);
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .toggle .line2 {
        opacity: 0;
    }

    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .tutorial-content {
        padding: 1.5rem;
    }

    .code-block {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 480px) {
    .container {
        width: 95%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .tutorial-content {
        padding: 1rem;
    }

    .section {
        margin-bottom: 2rem;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-button {
        text-align: center;
    }
}